home *** CD-ROM | disk | FTP | other *** search
/ CD-ROM Today - The Disc! 5 / CD-ROM Today - The Disc (Issue 5)(November 1994).ISO / mac / Mac shareware / Education / RLaB / rlib / clearall.r < prev    next >
Text File  |  1994-09-21  |  781b  |  34 lines

  1. //-------------------------------------------------------------------//
  2.  
  3. // Synopsis:    Clear all the variables from the workspace.
  4.  
  5. //  Syntax:    clearall ( )
  6.  
  7. //  Description:
  8.  
  9. //  The function clearall, clears all data objects from the workspace.
  10. //  Scalars, strings, matrices, and lists are cleared with the clear
  11. //  function. User function are not affected by clearall. If you wish
  12. //  to remove user functions you must do so explicitly with clear.
  13. //
  14.  
  15. //  See Also: clear
  16. //-------------------------------------------------------------------//
  17.  
  18.  
  19. clearall = function ( )
  20. {
  21.   local (i);
  22.  
  23.   for (i in members ($$))
  24.   {
  25.     if (class ($$.[i]) != "function")
  26.     {
  27.       if (i != "pi" && i != "eps" && i != "_rlab_search_path") 
  28.       {
  29.         clear ($$.[i]);
  30.       }
  31.     }
  32.   }
  33. };
  34.